package cn.xuguowen.user.designPatten.chain_of_responsibility.hsp;

/**
 * ClassName: Client
 * Package: cn.xuguowen.user.designPatten.chain_of_responsibility.hsp
 * Description: 客户端
 *
 * @Author 徐国文
 * @Create 2023/6/2 22:06
 * @Version 1.0
 */
public class Client {

    public static void main(String[] args) {
        PurchaseRequest purchaseRequest = new PurchaseRequest(1L,31000D);

        // 创建审批者对象
        Approver depApprover = new DepApprover("白铃老师");
        Approver collegeApprover = new CollegeApprover("张剑院长");
        Approver viceApprover = new ViceApprover("马双");
        Approver schoolMasterApprove = new SchoolMasterApprove("张传博");

        // 构造审批者上下级的关系 环形审批者
        depApprover.setApprover(collegeApprover);
        collegeApprover.setApprover(viceApprover);
        viceApprover.setApprover(schoolMasterApprove);
        schoolMasterApprove.setApprover(depApprover);

        // 开始审批
        depApprover.approve(purchaseRequest);
    }
}
